package com.demo;

/**
 * @Description: 正方形
 * @Author: JKchen
 * @Date: 2022/10/30 15:53
 */
public class Square  extends Shape{
    private double side;
    public Square(double side){
        super("正方形");
        this.side=side;
    }
    //面积
    @Override
    public double getArea() {
        return side*side;
    }
    //周长
    @Override
    public double getPerimeter() {
        return side*4;
    }
}
